package com.us.usws.common.resourcetree;

import net.iwsh.core.exception.NoSuchObjectException;

import com.us.usws.common.SiteConstants;
import com.us.usws.common.resourcetree.impl.ConsoleMenuTreeProvider;
import com.us.usws.common.resourcetree.model.DefaultResourceTree;
import com.us.usws.model.flat.system.DOUser;

/**
 *
 * @author Wang Jianbo
 */
public class ResourceTreeHelper {

	//private static Log log = LogFactory.getLog(ResourceTreeHelper.class);

	/**
	 * private constructor
	 */
	private ResourceTreeHelper() {
	}

	/**
	 * Get menu string to generate frontend menu
	 * @param rootId
	 * @return
	 * @throws NoSuchObjectException 
	 */
	public static DefaultResourceTree getConsoleMenuTree(long rootId, DOUser user) throws NoSuchObjectException {
		DefaultResourceTree obj = ResourceTreeLoader.getInstance().getResourceTreesByPrivilege(user,
				new ConsoleMenuTreeProvider(SiteConstants.SYSOBJ_CONSOLE_MENU_OBJ_ID));
		return obj;
	}

}
